/**
 * Copyright(c) 2010 Ceno Techonologies Co., Ltd.
 *
 * History:
 *   15-7-17 下午12:29 Created by hytsaber
 */
package com.jade.bss.business.scene.impl;

import java.util.Map;
import javax.annotation.PostConstruct;
import javax.ejb.TransactionAttribute;
import javax.inject.Inject;
import javax.inject.Named;

import com.jade.bss.business.scene.SceneData;
import com.jade.bss.business.scene.SceneDataDao;
import com.jade.framework.base.criterion.Criteria;
import com.jade.framework.base.util.PagingList;
import com.jade.framework.base.util.encryption.Encryption;
import com.jade.framework.base.util.encryption.EncryptionUtils;
import com.jade.bss.business.scene.SceneDataManager;
import org.springframework.transaction.annotation.Transactional;

/**
 * TODO: Must write comments.
 *
 * @author <a href="mailto:hytsaber@ceno.cn">hytsaber</a>
 * @version 1.0 15-7-17 下午12:29
 */
@Named ("bss_sceneDataManager")
public class SceneDataManagerImpl implements SceneDataManager
{
    protected SceneDataDao sceneDataDao;
    protected Encryption encryption = EncryptionUtils.getDefaultEncryption();

    @PostConstruct
    public void init()
    {
    }

    @Inject
    public void setSceneDataDao(@Named ("bss_sceneDataDao") SceneDataDao sceneDataDao)
    {
        this.sceneDataDao = sceneDataDao;
    }

    public PagingList<Map> query(Criteria criteria)
    {
        return sceneDataDao.query(criteria);
    }

    public String[] getColumns()
    {
        return sceneDataDao.getColumns();
    }

    @TransactionAttribute
    @Transactional (rollbackFor = Throwable.class)
    public long add(SceneData sceneData)
    {
        return sceneDataDao.add(sceneData);
    }
}
